home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung / Power-Programmierung (Tewi)(1994).iso / magazine / pctchnqs / 1991 / number6 / pctrob.rlz < prev    next >
Text File  |  1991-12-16  |  2KB  |  72 lines

  1. 'Client application - the walker
  2.  
  3. RUN "StdSys"
  4. RUN "Animate"
  5.  
  6. PROC EndWalk(p)
  7.   IF p[_Invoke] <> _Close THEN
  8.     AnimateControl(_Stop)
  9.     FormModifyObject(20,_Normal,100 pct,100 pct)
  10.     DDEControl(_Poke, "Command", "ManOut")
  11.   END IF
  12. END PROC
  13.  
  14. PROC MakeForm
  15.   LOCAL width, i, j, cell
  16.   'Create a form with an animation window
  17.   FormNew(FormQUnique; "Tech Walker", _Close)
  18.   FormControl(_Size;_Center, _Center, 100 pct, 100 pct)
  19.   FormSetObject(20,_Animate,"",_Center,_Center,100 pct,100 pct)
  20.   FormControl(_Show)
  21.   FormSetProc(EndWalk)
  22.  
  23.   'Prepare the animation
  24.   AnimateSelect(20)
  25.   AnimateCells("\realizer\demos\animate\bitmaps\MAN#.BMP", 1, 3)
  26.   CellOrder = {1, 2, 3, 2}
  27.  
  28.   width = FormQObject(20)[_FQO_Width]
  29.   j = 0
  30.   i = 0
  31.   WHILE j < width
  32.     cell = CellOrder[i Mod 4 + 1]
  33.     AnimateFrame(cell, j, 10, 100)
  34.     i = i + 1
  35.     j = j + 15
  36.   END WHILE
  37.   AnimateSpecialFrame(_Notify)
  38.   AnimateSpecialFrame(_Stop)
  39. END PROC
  40.  
  41.  
  42. PROC HandleDDE(Session, message, Topic, Data)
  43.   IF Message = _Close THEN
  44.     EXIT SYSTEM
  45.   END IF
  46.  
  47.   DDESelect(Session)
  48.   IF Topic = "Command" THEN
  49.     SELECT CASE Data
  50.     CASE "TooMany"
  51.       INPUT "Sorry, too many sessions are running.";
  52.       EXIT SYSTEM
  53.     CASE "StartWalk"
  54.       AnimateControl(_Restart)
  55.       FormModifyObject(20, _Normal, _Center, _Center, 100 pct, 100 pct)
  56.     END SELECT
  57.   ELSEIF Topic = "Title" THEN
  58.     SetAppName(Data)
  59.   END IF
  60. END PROC
  61.  
  62. SetSys(_Size, {_Default, _Default, 60 pct, 40 pct})
  63. MakeForm
  64.  
  65. IF DDENew(DDEQUnique, "PCTech", "Animate") THEN
  66.   DDESetProc(HandleDDE)
  67. ELSE
  68.   INPUT "Please make sure the controller is running.";
  69.   EXIT SYSTEM
  70. END IF
  71.  
  72.